package com.eclink.asset.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eclink.asset.domain.CommonUser;
import com.eclink.asset.service.CommonUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api("用户接口列表")
@RestController
@RequestMapping("/user")
public class CommonUserController {

    @Resource
    private CommonUserService commonUserService;


    @ApiOperation("显示用户列表")
    @GetMapping("/list")
    public ResponseEntity<Page<CommonUser>> list(Pageable page) {
        return ResponseEntity.ok(commonUserService.selectList(page));
    }


    @ApiOperation("显示用户列表")
    @GetMapping("/listAll")
    public ResponseEntity<List<CommonUser>> listAll() {
        return ResponseEntity.ok(commonUserService.selectAll());
    }

    @ApiOperation("显示用户列表")
    @GetMapping("/listDetailAll")
    public ResponseEntity<List<CommonUser>> listDetailAll() {

        return ResponseEntity.ok(commonUserService.selectDetailAll());
    }

}
